package com.lagou.config;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

/**
 * Created by Administrator on 2021/3/10.
 */
public class SpringApplication {
    public static void run(String[] args) {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort( 8080 );
        try {
            tomcat.addWebapp( "/", "E:\\IDEA2020pojie\\self-springboot" );
            tomcat.start();
            tomcat.getServer().await();
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (LifecycleException e) {
            e.printStackTrace();
        }
    }
}
